package handler

import (
	"RMS/app/shop/lib"
	"RMS/app/shop/model"
	"RMS/common"
	"github.com/gin-gonic/gin"
)

func AddItem(c *gin.Context) interface{} {
	//file, err := c.FormFile("file")
	//if err != nil {
	//	c.String(500, "上传图片出错")
	//	return
	//}
	req := &model.AddItemReq{}
	if err := c.BindJSON(req); err != nil {
		resp := &model.AddItemResp{}
		resp.Status = common.ErrCode
		resp.Message = common.ReqErr
		return resp
	}
	resp := lib.ImplAddItem(c, req)
	return resp
}
